import Home from '@/pages/Home'
import Login from '@/pages/Login'
import Register from '@/pages/Register'
import Search from '@/pages/Search'
import Detail from '@/pages/Detail'
import AddCartSuccess from '@/pages/AddCartSuccess'


export default [
  {
    path:'/home',
    component:Home
  },
  {
    path:'/search/:keyword?',
    component:Search,
    name:'search',
    props(route){
      return {keyword:route.params.keyword,keyword1:route.query.keyword1}
    }
  },
  {
    path:'/login',
    component:Login,
    meta:{
      // 这个对象当中可以配置自己想要的任何数据
      isHidden:true
    }
  },
  {
    path:'/register',
    component:Register,
    meta:{
      // 这个对象当中可以配置自己想要的任何数据
      isHidden:true
    }
  },
  {
    path:'/detail/:skuId',  //skuId代表是商品的id
    component:Detail,
  },
  {
    path:'/addcartsuccess',  //skuId代表是商品的id
    component:AddCartSuccess,
  },
  {
    path:'/',
    redirect:'/home'
  }
]